package common.com.androidbase.datarequest;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by shaohualiu on 2015/12/11.
 */
public class CornerMark implements Parcelable {
    public static final int TYPE_VIP = 1; // 会员
    public static final int TYPE_NEW = 2; // 新
    public static final int TYPE_TRAILER = 3; // 预告
    private String text;
    private int type;

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public CornerMark() {

    }

    public CornerMark(Parcel source) {
        text = source.readString();
        type = source.readInt();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(text);
        parcel.writeInt(type);
    }

    /**
     * Intent传递时序列化
     */
    public static final Creator<CornerMark> CREATOR = new Creator<CornerMark>() {

        @Override
        public CornerMark[] newArray(int size) {
            return new CornerMark[size];
        }

        // 将Parcel对象反序列化为Parcelable
        @Override
        public CornerMark createFromParcel(Parcel source) {
            return new CornerMark(source);
        }
    };
}
